<?php

require_once("includes/config.inc");


if (isVal("deleteWorker")){
    SqlWork::getInstance()->Perform("DELETE FROM worker WHERE idWorker = ?",array($_POST["id"]));
}

if (isVal("deleteDepartment")){
    SqlWork::getInstance()->Perform("DELETE FROM Department WHERE IdDep = ?",array($_POST["id"]));
}


if (isVal("deleteTypesObJobs")){
    SqlWork::getInstance()->Perform("DELETE FROM typesOfJobs WHERE idJob = ?",array($_POST["id"]));
}

if (isVal("deleteEquipment")){
    SqlWork::getInstance()->Perform("DELETE FROM Equipment WHERE idEq = ?",array($_POST["id"]));
}

if (isVal("deleteTypeEquipment")){
    SqlWork::getInstance()->Perform("DELETE FROM typeEquipment WHERE idTypeEq = ?",array($_POST["id"]));
}

if (isVal("deleteMaterialClass")){
    SqlWork::getInstance()->Perform("DELETE FROM materialClass WHERE idMaterialClass = ?",array($_POST["id"]));
}
if (isVal("deleteMaterial")){
    SqlWork::getInstance()->Perform("DELETE FROM material WHERE idMaterial = ?",array($_POST["id"]));
}





function isVal($value){
    return isset($_POST["command"]) && $_POST["command"] == $value;
}